XR API 2.4
Loading...
Searching...
No Matches
xr_api_wrapper.h
Go to the documentation of this file.
1
23#ifndef XR_API_WRAPPER_H_
24#define XR_API_WRAPPER_H_
25
30
31// = Standard Library =============================
32#include <vector>
33
34XR_DEFINE_HANDLE(SonyOzSessionHandle);
35
40namespace sony::oz::xr_runtime {
41
42/******************************************************************************
43 * Load/Unload xr runtime library process
44 */
45
57
58
66
67/******************************************************************************
68 * Device library process
69 */
70
92SonyOzResult GetDeviceNum(SonyOzPlatformId platform_id, uint64_t* num);
93
118 SonyOzDeviceInfo* device_list);
119
120/******************************************************************************
121 * Log process
122 */
123
144
145/******************************************************************************
146 * Session process
147 */
148
191 const SonyOzDeviceInfo* device,
192 RUNTIME_OPTION_BIT_FLAG runtime_option_bit_flag,
193 PLATFORM_OPTION_BIT_FLAG platform_option_bit_flag,
194 SonyOzSessionHandle* session);
195
216SonyOzResult DestroySession(SonyOzSessionHandle* session);
217
246SonyOzResult BeginSession(SonyOzSessionHandle session);
247
275SonyOzResult EndSession(SonyOzSessionHandle session);
276
294SonyOzResult GetSessionState(SonyOzSessionHandle session,
295 SonyOzSessionState* session_state);
296
297/******************************************************************************
298 * Tracking process
299 */
300
319SonyOzResult UpdateTrackingResultCache(SonyOzSessionHandle session);
320
348SonyOzResult GetCachedPose(SonyOzSessionHandle session, SonyOzPoseId pose_id,
349 SonyOzPosef* pose, bool* is_valid);
350
376SonyOzResult GetProjection(SonyOzSessionHandle session, SonyOzPoseId pose_id,
377 SonyOzProjection* projection);
378
379/******************************************************************************
380 * Rendering process
381 */
382
407SonyOzResult SubmitD3d11(SonyOzSessionHandle session, ID3D11Device* device,
408 ID3D11Texture2D* side_by_side, bool flip_y_position,
409 ID3D11Texture2D* target);
410
438SonyOzResult SubmitD3d12(SonyOzSessionHandle session,
439 ID3D12CommandQueue* command_queue, uint32_t node_mask,
440 ID3D12Resource* side_by_side, bool flip_y_position,
441 DXGI_FORMAT format, ID3D12Resource* target);
442
465SonyOzResult SubmitOpengl(SonyOzSessionHandle session,
466 unsigned int side_by_side, bool flip_y_position,
467 unsigned int target);
468
495SonyOzResult SubmitMultiPassD3d11(SonyOzSessionHandle session,
496 ID3D11Device* device, ID3D11Texture2D* left,
497 ID3D11Texture2D* right, bool flip_y_position,
498 ID3D11Texture2D* target);
499
530SonyOzResult SubmitMultiPassD3d12(SonyOzSessionHandle session,
531 ID3D12CommandQueue* command_queue,
532 uint32_t node_mask, ID3D12Resource* left,
533 ID3D12Resource* right, bool flip_y_position,
534 DXGI_FORMAT format, ID3D12Resource* target);
535
560SonyOzResult SubmitMultiPassOpengl(SonyOzSessionHandle session,
561 unsigned int left, unsigned int right,
562 bool flip_y_position, unsigned int target);
563
564/******************************************************************************
565 * Data set/get process
566 */
567
586SonyOzResult EnableStereo(SonyOzSessionHandle session, bool enable);
587
588
605SonyOzResult GetTargetMonitorRectangle(SonyOzSessionHandle session,
606 SonyOzRect* rect);
607
626SonyOzResult GetDisplaySpec(SonyOzSessionHandle session,
627 SonyOzDisplaySpec* display_spec);
628
629/******************************************************************************
630 * System error process
631 */
632
651SonyOzResult GetXrSystemError(SonyOzSessionHandle session,
652 SonyOzXrSystemError* error);
653
672SonyOzResult GetXrSystemErrorNum(SonyOzSessionHandle session, uint16_t* num);
673
696SonyOzResult GetXrSystemErrorList(SonyOzSessionHandle session, uint16_t num,
697 SonyOzXrSystemError* errors);
698
699SonyOzResult SetColorSpace(SonyOzSessionHandle session, int input_gamma_count,
700 int output_gamma_count, float gamma);
701} // namespace sony::oz::xr_runtime
702
703#endif // XR_API_WRAPPER_H_
void(*)(const char *, SonyOzLogSettings_LogLevels) SonyOzLogSettings_LogCallback
Definition log_defs.h:33
Definition load_library_utility.h:34
SonyOzResult SubmitMultiPassD3d12(SonyOzSessionHandle session, ID3D12CommandQueue *command_queue, uint32_t node_mask, ID3D12Resource *left, ID3D12Resource *right, bool flip_y_position, DXGI_FORMAT format, ID3D12Resource *target)
Generate D3D12 render textures and shaders for off-screen rendering and shaders. (multi-pass)
SonyOzResult GetSessionState(SonyOzSessionHandle session, SonyOzSessionState *session_state)
Obtain session status.
SonyOzResult GetXrSystemErrorList(SonyOzSessionHandle session, uint16_t num, SonyOzXrSystemError *errors)
Obtain errors occurred in XR Runtime.
SonyOzResult GetXrSystemErrorNum(SonyOzSessionHandle session, uint16_t *num)
Obtain the number of errors occured in XR Runtime.
SonyOzResult EnumerateDevices(SonyOzPlatformId platform_id, uint64_t size, SonyOzDeviceInfo *device_list)
Obtain information on available devices.
SonyOzResult GetDeviceNum(SonyOzPlatformId platform_id, uint64_t *num)
Get the number of available devices.
SonyOzResult SubmitD3d12(SonyOzSessionHandle session, ID3D12CommandQueue *command_queue, uint32_t node_mask, ID3D12Resource *side_by_side, bool flip_y_position, DXGI_FORMAT format, ID3D12Resource *target)
Generate render textures and shaders for D3D11. (single pass)
SonyOzResult SetDebugLogCallback(SonyOzPlatformId platform_id, SonyOzLogSettings_LogCallback callback)
Change the log output destination to the specified function.
SonyOzResult EndSession(SonyOzSessionHandle session)
Terminate the session with XR Platform.
SonyOzResult GetCachedPose(SonyOzSessionHandle session, SonyOzPoseId pose_id, SonyOzPosef *pose, bool *is_valid)
Obtain information about the camera.
SonyOzResult SubmitMultiPassOpengl(SonyOzSessionHandle session, unsigned int left, unsigned int right, bool flip_y_position, unsigned int target)
Generate render textures and shaders for D3D11. (single pass)
SonyOzResult LinkXrLibrary(SonyOzPlatformId platform_id)
Link the library and make the API available.
SonyOzResult SubmitMultiPassD3d11(SonyOzSessionHandle session, ID3D11Device *device, ID3D11Texture2D *left, ID3D11Texture2D *right, bool flip_y_position, ID3D11Texture2D *target)
Generate D3D11 render textures and shaders for off-screen rendering and shaders. (multi-pass)
SonyOzResult BeginSession(SonyOzSessionHandle session)
Start a session with the XR Platform.
SonyOzResult EnableStereo(SonyOzSessionHandle session, bool enable)
Enables/disables stereo rendering.
SonyOzResult SubmitOpengl(SonyOzSessionHandle session, unsigned int side_by_side, bool flip_y_position, unsigned int target)
Generate render textures and shaders for D3D11. (single pass)
SonyOzResult GetTargetMonitorRectangle(SonyOzSessionHandle session, SonyOzRect *rect)
Obtain information on the target monitor.
SonyOzResult SubmitD3d11(SonyOzSessionHandle session, ID3D11Device *device, ID3D11Texture2D *side_by_side, bool flip_y_position, ID3D11Texture2D *target)
Generate render textures and shaders for D3D11. (single pass)
SonyOzResult DestroySession(SonyOzSessionHandle *session)
Destroy session with XR Platform.
SonyOzResult UpdateTrackingResultCache(SonyOzSessionHandle session)
Update the cache of tracking data.(for Game Thread)
void UnlinkXrLibrary()
Terminate use of XR API and unlink the library.
SonyOzResult SetColorSpace(SonyOzSessionHandle session, int input_gamma_count, int output_gamma_count, float gamma)
SonyOzResult GetXrSystemError(SonyOzSessionHandle session, SonyOzXrSystemError *error)
Obtain an error occurred in XR Runtime.
SonyOzResult CreateSession(SonyOzPlatformId platform_id, const SonyOzDeviceInfo *device, RUNTIME_OPTION_BIT_FLAG runtime_option_bit_flag, PLATFORM_OPTION_BIT_FLAG platform_option_bit_flag, SonyOzSessionHandle *session)
Create session with XR Platform.
SonyOzResult GetProjection(SonyOzSessionHandle session, SonyOzPoseId pose_id, SonyOzProjection *projection)
Obtain Projection.
SonyOzResult GetDisplaySpec(SonyOzSessionHandle session, SonyOzDisplaySpec *display_spec)
Obtain information about the display.
Device information.
Definition xr_api_defs.h:132
Display information.
Definition xr_api_defs.h:391
pose(position, orientation)
Definition xr_api_defs.h:279
Definition xr_api_defs.h:451
Rectangle.
Definition xr_api_defs.h:112
Sytem error occurred in XR Runtime.
Definition xr_api_defs.h:432
#define XR_DEFINE_HANDLE(object)
Definition xr_api_defs.h:48
SonyOzPoseId
Definition xr_api_defs.h:445
DXGI_FORMAT
Definition xr_api_defs.h:469
const char * SonyOzPlatformId
ID indicating XR platform. It will always be "Spatial Reality Display".
Definition xr_api_defs.h:93
SonyOzSessionState
session state
Definition xr_api_defs.h:99
SonyOzResult
Result of XR Runtime API.
Definition xr_api_defs.h:62
uint8_t PLATFORM_OPTION_BIT_FLAG
Definition xr_platform_option.h:24
uint8_t RUNTIME_OPTION_BIT_FLAG
Definition xr_runtime_option.h:24